package org.swingDemo.helper;

import java.io.InputStream;
import java.util.*;

public class ClassifyOptionHelper {
    private static boolean recursiveSubDir = true;
    private static boolean persistSubDir = true;
    private static boolean copyOrMove = true;   // copy: true, move: false
    private static String fileExtension = "pdf;md;";
    private static String folderMap = "Python=python;Java=java;C++=c++;Html=html,css;C=c;" +
            "Linux=linux;5G=5g;Android=android;Go=go;MATLAB=matlab;R=r;" +
            "操作系统=操作系统;算法=算法;新技术=云计算,大数据,物联网,机器学习,人工智能,深度学习;" +
            "计算机网络=网络,路由,网;软件工程=软件工程;计算机=计算机;正则表达式=正则;" +
            "数据库=数据库,mysql,sqlserver,oracle,sql;";

    private static String sourcePath = "";

    static {
        try {
            InputStream inStream = ClassifyOptionHelper.class.getResourceAsStream("/resources.properties");
            ResourceBundle resourceBundle = new PropertyResourceBundle(inStream);
            if (resourceBundle.containsKey("folderMap")) {
                setFolderMap(resourceBundle.getString("folderMap"));
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public static boolean isRecursiveSubDir() {
        return recursiveSubDir;
    }

    public static void setRecursiveSubDir(boolean recursiveSubDir) {
        ClassifyOptionHelper.recursiveSubDir = recursiveSubDir;
    }

    public static boolean isPersistSubDir() {
        return persistSubDir;
    }

    public static void setPersistSubDir(boolean persistSubDir) {
        ClassifyOptionHelper.persistSubDir = persistSubDir;
    }

    public static boolean isCopyOrMove() {
        return copyOrMove;
    }

    public static void setCopyOrMove(boolean copyOrMove) {
        ClassifyOptionHelper.copyOrMove = copyOrMove;
    }

    public static String getFileExtension() {
        return fileExtension;
    }

    public static void setFileExtension(String fileExtension) {
        ClassifyOptionHelper.fileExtension = fileExtension;
    }

    public static String getFolderMap() {
        return folderMap;
    }

    public static void setFolderMap(String folderMap) {
        ClassifyOptionHelper.folderMap = folderMap;
    }

    public static String getSourcePath() {
        return sourcePath;
    }

    public static void setSourcePath(String sourcePath) {
        ClassifyOptionHelper.sourcePath = sourcePath;
    }

}
